/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.isd.inventario.modelo;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Claudio
 */
@Embeddable
public class SustitutosPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "USR_PRDSUS_TIPPRO", nullable = false, length = 6)
    private String tippro;
    @Basic(optional = false)
    @Column(name = "USR_PRDSUS_ARTCOD", nullable = false, length = 30)
    private String artcod;
    @Basic(optional = false)
    @Column(name = "USR_PRDSUS_TIPSUS", nullable = false, length = 6)
    private String tipsus;
    @Basic(optional = false)
    @Column(name = "USR_PRDSUS_ARTSUS", nullable = false, length = 30)
    private String artsus;

    public SustitutosPK() {

    }

    public String getArtcod() {
        return artcod;
    }

    public void setArtcod(String artcod) {
        this.artcod = artcod;
    }

    public String getArtsus() {
        return artsus;
    }

    public void setArtsus(String artsus) {
        this.artsus = artsus;
    }

    public String getTippro() {
        return tippro;
    }

    public void setTippro(String tippro) {
        this.tippro = tippro;
    }

    public String getTipsus() {
        return tipsus;
    }

    public void setTipsus(String tipsus) {
        this.tipsus = tipsus;
    }
    
    public SustitutosPK(String usrPrdsusTippro, String usrPrdsusArtcod, String usrPrdsusTipsus, String usrPrdsusArtsus) {
        this.tippro = usrPrdsusTippro;
        this.artcod = usrPrdsusArtcod;
        this.tipsus = usrPrdsusTipsus;
        this.artsus = usrPrdsusArtsus;
    }  

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tippro != null ? tippro.hashCode() : 0);
        hash += (artcod != null ? artcod.hashCode() : 0);
        hash += (tipsus != null ? tipsus.hashCode() : 0);
        hash += (artsus != null ? artsus.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SustitutosPK)) {
            return false;
        }
        SustitutosPK other = (SustitutosPK) object;
        if ((this.tippro == null && other.tippro != null) || (this.tippro != null && !this.tippro.equals(other.tippro))) {
            return false;
        }
        if ((this.artcod == null && other.artcod != null) || (this.artcod != null && !this.artcod.equals(other.artcod))) {
            return false;
        }
        if ((this.tipsus == null && other.tipsus != null) || (this.tipsus != null && !this.tipsus.equals(other.tipsus))) {
            return false;
        }
        if ((this.artsus == null && other.artsus != null) || (this.artsus != null && !this.artsus.equals(other.artsus))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "tv.inventario.modelo.SustitutosPK[tippro=" + tippro + ", artcod=" + artcod + ", tipsus=" + tipsus + ", artsus=" + artsus + "]";
    }

}
